<?php
include '../init.php';


// 没有登录,非管理员都不能进入后台
if (!@$_SESSION['is_login'] || empty(@$_SESSION['uid'])) {
	show_msg(1, '请先登录', $time = 3, $url = '../index.php');
	exit();
}

if (!@$_SESSION['isAdmin']){
	show_msg(1, '非管理员不可进入后台', $time = 3, $url = '../index.php');
	exit();
}


// 获取参数引入对应的板块
$action = intval(@$_GET['action']);
if (empty($action)) {
	$action = 1;
}

?>
<!DOCTYPE html>
<html>
<head>
    <title>欢迎进入后台管理</title>
    <meta charset="utf-8">
	<style type="text/css">
    * {
        margin: 0;
        padding: 0;
        list-style-type: none;
    }
    a:link{
        color: rgb(200,200,200);
        text-decoration:none;
    }
    a:visited{
        color: rgb(200,200,200);
        text-decoration:none;
    }
    a:active{
        color: rgb(200,200,200);
        text-decoration:none;
    }
    header {
        height: 54px;
        line-height: 54px;
        background: rgb(84,139,247);
        color: white;
        font-size: 16px;
    }
    .header-article {
        float: right;
        margin-right: 20px;
    }
    section nav {
        margin: 2px;
        width: 220px;
        height: 90%;
		float: left;
        border:1px solid rgb(214,214,214);
    }
	section {
		min-width: 1020px;
	}
    .menu-body li {
        margin: 10px 5px;
        color: white;
        background-color: rgb(214,214,214);
        height: 48px;
        line-height: 48px;
        padding-left: 35px;
    }
    .menu-body .min-menu{
        height: 32px;
        line-height: 32px;
        font-size: 13px;
        text-align: left;
        padding-left: 5px;
        background-color: rgb(200,200,200);
        border:1px solid rgb(214,214,214);
    } 
    .active {
        height: 46px;
        line-height: 46px;
        border: 1px dotted red;
    }
    .main-body {
        float: left;
        line-height: 48px;
    　　min-width: 600px;
    }
    </style>
</head>
<body>

	<header>
    <article class="header-article">
        欢迎你 !  :  <span style="color:red;"><?php echo $_SESSION['alias'] ?></span>, 今天是 <?php echo date('Y年m月d日'); ?>
    </article>
	</header>

	<section>
	    <!-- 右侧导航栏 -->
	    <nav class="right-nav">
            <ul class="menu-body">

                <li class="min-menu">用户管理</li>
				<!-- 默认显示所有用户,通过一个个过滤条件调整 -->
                <!-- 显示用户可用状态,冻结,禁言,是否是vip -->
                <!-- 查询操作,可以快捷操作 -->
                <a href="index.php?action=1"><li <?php echo $action==1?'class="active"':''; ?>>管理用户</li></a>
                <a href="index.php?action=8"><li <?php echo $action==8?'class="active"':''; ?>>审核版主</li></a>


                <li class="min-menu">分区管理</li>
                <a href="index.php?action=2"><li <?php echo $action==2?'class="active"':''; ?>>添加分区</li></a>
                <a href="index.php?action=3"><li <?php echo $action==3?'class="active"':''; ?>>添加板块</li></a>
                <!-- 修改名称,修改管理员,修改板块的所属于的分区 -->
                <a href="index.php?action=4"><li <?php echo $action==4?'class="active"':''; ?>>管理分区</li></a>


                <li class="min-menu">友情链接</li>
                <!-- 显示有效时间和可用状态 -->
                <a href="index.php?action=5"><li <?php echo $action==5?'class="active"':''; ?>>新的申请</li></a>
                <a href="index.php?action=6"><li <?php echo $action==6?'class="active"':''; ?>>所有链接</li></a>


                <li class="min-menu">帖子管理</li>
                <!-- 显示帖子回收站 -->
                <a href="index.php?action=7"><li <?php echo $action==7?'class="active"':''; ?>>回收站</li></a>

            </ul>
	    </nav>

	    <!-- 右侧引入内容区域 -->
	    <article class="main-body">
			<?php
				switch($action) {
					case 1:
						include 'user_manager.php';
						break;
					case 2:
						include 'add_zone.php';
						break;
					case 3:
						include 'add_modul.php';
						break;
					case 4:
                        include 'zone_modul_manager.php';
                        break;
					case 5:
						include 'flink_apply.php';
						break;
                    case 6:
                        include 'flink_all.php';
                        break;
                    case 7:
                        include 'post_list_manager.php';
                        break;
                    case 8:
                        include 'moderator.php';
                        break;
				}
			?>

	    </article>
	</section>

</body>
</html>